

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>5.1. Coordinate/Trajectory Readers and Writers — MDAnalysis.coordinates &mdash; MDAnalysis v0.7.5-devel documentation</title>
    <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '0.7.5-devel',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within MDAnalysis v0.7.5-devel documentation"
          href="../../_static/opensearch.xml"/>
    <link rel="shortcut icon" href="../../_static/mdanalysis-logo.ico"/>
    <link rel="top" title="MDAnalysis v0.7.5-devel documentation" href="../../index.html" />
    <link rel="up" title="5. Coordinates modules" href="../coordinates_modules.html" />
    <link rel="next" title="5.2. Base classes — MDAnalysis.coordinates.base" href="base.html" />
    <link rel="prev" title="5. Coordinates modules" href="../coordinates_modules.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="base.html" title="5.2. Base classes — MDAnalysis.coordinates.base"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="../coordinates_modules.html" title="5. Coordinates modules"
             accesskey="P">previous</a> |</li>
        <li><a href="../../index.html">MDAnalysis v0.7.5-devel documentation</a> &raquo;</li>
          <li><a href="../coordinates_modules.html" accesskey="U">5. Coordinates modules</a> &raquo;</li> 
      </ul>
    </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/mdanalysis-logo-200x150.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">5.1. Coordinate/Trajectory Readers and Writers  &#8212; <tt class="docutils literal"><span class="pre">MDAnalysis.coordinates</span></tt></a><ul>
<li><a class="reference internal" href="#supported-coordinate-formats">5.1.1. Supported coordinate formats</a></li>
<li><a class="reference internal" href="#trajectory-api">5.1.2. Trajectory API</a><ul>
<li><a class="reference internal" href="#history">5.1.2.1. History</a></li>
<li><a class="reference internal" href="#registry">5.1.2.2. Registry</a></li>
<li><a class="reference internal" href="#timestep-class">5.1.2.3. Timestep class</a><ul>
<li><a class="reference internal" href="#methods">5.1.2.3.1. Methods</a></li>
<li><a class="reference internal" href="#attributes">5.1.2.3.2. Attributes</a></li>
<li><a class="reference internal" href="#private-attributes">5.1.2.3.3. Private attributes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#trajectory-reader-class">5.1.2.4. Trajectory Reader class</a><ul>
<li><a class="reference internal" href="#id8">5.1.2.4.1. Methods</a></li>
<li><a class="reference internal" href="#id9">5.1.2.4.2. Attributes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#trajectory-writer-class">5.1.2.5. Trajectory Writer class</a><ul>
<li><a class="reference internal" href="#id10">5.1.2.5.1. Methods</a></li>
<li><a class="reference internal" href="#id11">5.1.2.5.2. Attributes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#single-frame-writer-class">5.1.2.6. Single Frame Writer class</a><ul>
<li><a class="reference internal" href="#id12">5.1.2.6.1. Methods</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#reader-writer-registry">5.1.3. Reader/Writer registry</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="../coordinates_modules.html"
                        title="previous chapter">5. Coordinates modules</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="base.html"
                        title="next chapter">5.2. Base classes &#8212; <tt class="docutils literal docutils literal docutils literal"><span class="pre">MDAnalysis.coordinates.base</span></tt></a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/documentation_pages/coordinates/init.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <span class="target" id="module-MDAnalysis.coordinates.__init__"></span><div class="section" id="coordinate-trajectory-readers-and-writers-mdanalysis-coordinates">
<h1>5.1. Coordinate/Trajectory Readers and Writers  &#8212; <tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.coordinates</span></tt><a class="headerlink" href="#coordinate-trajectory-readers-and-writers-mdanalysis-coordinates" title="Permalink to this headline">¶</a></h1>
<p>The coordinates submodule contains code to read coordinates, either
single frames (e.g. the PDB module) or trajectories (such as the DCD
reader). All readers are supposed to expose a <tt class="xref py py-class docutils literal"><span class="pre">Reader</span></tt> object
that presents a common <a class="reference internal" href="#trajectory-api">Trajectory API</a> to other code.</p>
<p>The <a class="reference internal" href="../core/AtomGroup.html#MDAnalysis.core.AtomGroup.Universe" title="MDAnalysis.core.AtomGroup.Universe"><tt class="xref py py-class docutils literal"><span class="pre">Universe</span></tt></a> contains the API
entry point attribute</p>
<blockquote>
<div><tt class="xref py py-attr docutils literal"><span class="pre">Universe.trajectory</span></tt></div></blockquote>
<p>that points to the actual <a class="reference internal" href="base.html#MDAnalysis.coordinates.base.Reader" title="MDAnalysis.coordinates.base.Reader"><tt class="xref py py-class docutils literal"><span class="pre">Reader</span></tt></a>
object; all Readers are supposed to be accessible through this entry
point in the same manner (&#8220;<a class="reference external" href="http://c2.com/cgi/wiki?DuckTyping">duck typing</a>&#8221;).</p>
<p>In order to <strong>write coordinates</strong>, a factory function is provided
(<a class="reference internal" href="core.html#MDAnalysis.coordinates.core.writer" title="MDAnalysis.coordinates.core.writer"><tt class="xref py py-func docutils literal"><span class="pre">MDAnalysis.coordinates.core.writer()</span></tt></a>) which is made available
as <tt class="xref py py-func docutils literal"><span class="pre">MDAnalysis.Writer()</span></tt>) that returns a <em>Writer</em> appropriate for
the desired file format (as indicated by the filename
suffix). Furthermore, a trajectory
<a class="reference internal" href="base.html#MDAnalysis.coordinates.base.Reader" title="MDAnalysis.coordinates.base.Reader"><tt class="xref py py-class docutils literal"><span class="pre">Reader</span></tt></a> can also have a method
<a class="reference internal" href="base.html#MDAnalysis.coordinates.base.Reader.Writer" title="MDAnalysis.coordinates.base.Reader.Writer"><tt class="xref py py-meth docutils literal"><span class="pre">Writer()</span></tt></a> that returns an
appropriate <a class="reference internal" href="base.html#MDAnalysis.coordinates.base.Writer" title="MDAnalysis.coordinates.base.Writer"><tt class="xref py py-class docutils literal"><span class="pre">Writer</span></tt></a> for the file
format of the trajectory.</p>
<p>In analogy to <a class="reference internal" href="core.html#MDAnalysis.coordinates.core.writer" title="MDAnalysis.coordinates.core.writer"><tt class="xref py py-func docutils literal"><span class="pre">MDAnalysis.coordinates.core.writer()</span></tt></a>, there is
also a <a class="reference internal" href="core.html#MDAnalysis.coordinates.core.reader" title="MDAnalysis.coordinates.core.reader"><tt class="xref py py-func docutils literal"><span class="pre">MDAnalysis.coordinates.core.reader()</span></tt></a> function available
to return a trajectory <a class="reference internal" href="base.html#MDAnalysis.coordinates.base.Reader" title="MDAnalysis.coordinates.base.Reader"><tt class="xref py py-class docutils literal"><span class="pre">Reader</span></tt></a>
instance although this is often not needed because the
<a class="reference internal" href="../core/AtomGroup.html#MDAnalysis.core.AtomGroup.Universe" title="MDAnalysis.core.AtomGroup.Universe"><tt class="xref py py-class docutils literal"><span class="pre">Universe</span></tt></a> class can choose an
appropriate reader automatically.</p>
<div class="section" id="supported-coordinate-formats">
<h2>5.1.1. Supported coordinate formats<a class="headerlink" href="#supported-coordinate-formats" title="Permalink to this headline">¶</a></h2>
<p>The table below lists the coordinate file formats understood by MDAnalysis. The
emphasis is on formats that are used in popular molecular dynamics
codes. MDAnalysis figures out formats by looking at the extension. Thus, a DCD
file always has to end with &#8221;.dcd&#8221; to be recognized as such. (A number of files
are also recognized when they are compressed with <strong class="program">gzip</strong> or
<strong class="program">bzip2</strong> such as &#8221;.xyz.bz2&#8221;.)</p>
<table border="1" class="docutils" id="id1">
<caption>Table of Supported coordinate formats</caption>
<colgroup>
<col width="17%" />
<col width="13%" />
<col width="8%" />
<col width="62%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Name</th>
<th class="head">extension</th>
<th class="head">IO</th>
<th class="head">remarks</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>CHARMM,
NAMD,
LAMMPS</td>
<td>dcd</td>
<td>r/w</td>
<td>standard CHARMM binary trajectory; endianness is
autodetected. Fixed atoms may not be handled
correctly (requires testing). Module
<a class="reference internal" href="DCD.html#module-MDAnalysis.coordinates.DCD" title="MDAnalysis.coordinates.DCD"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.coordinates.DCD</span></tt></a></td>
</tr>
<tr><td>Gromacs</td>
<td>xtc</td>
<td>r/w</td>
<td>Compressed (lossy) xtc trajectory format. Module
<a class="reference internal" href="XTC.html#module-MDAnalysis.coordinates.XTC" title="MDAnalysis.coordinates.XTC"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.coordinates.XTC</span></tt></a></td>
</tr>
<tr><td>Gromacs</td>
<td>trr</td>
<td>r/w</td>
<td>Full precision trr trajectory. Only coordinates are
processed at the moment. Module
<a class="reference internal" href="TRR.html#module-MDAnalysis.coordinates.TRR" title="MDAnalysis.coordinates.TRR"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.coordinates.TRR</span></tt></a></td>
</tr>
<tr><td>XYZ</td>
<td>xyz</td>
<td>r</td>
<td>Generic white-space separate XYZ format; can be
compressed. Module
<a class="reference internal" href="XYZ.html#module-MDAnalysis.coordinates.XYZ" title="MDAnalysis.coordinates.XYZ"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.coordinates.XYZ</span></tt></a></td>
</tr>
<tr><td>Amber</td>
<td>trj,
mdcrd</td>
<td>r</td>
<td>formatted (ASCII) trajectories; the presence of a
periodic box is autodetected (<em>experimental</em>).
Module <a class="reference internal" href="TRJ.html#module-MDAnalysis.coordinates.TRJ" title="MDAnalysis.coordinates.TRJ"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.coordinates.TRJ</span></tt></a></td>
</tr>
<tr><td>Brookhaven
<a class="footnote-reference" href="#a" id="id2">[1]</a></td>
<td>pdb</td>
<td>r/w</td>
<td>a simplified PDB format (as used in MD simulations)
is read by default; the full format can be read by
supplying the <cite>permissive=False</cite> flag to
<tt class="xref py py-class docutils literal"><span class="pre">MDAnalysis.Universe</span></tt>. Module
<a class="reference internal" href="PDB.html#module-MDAnalysis.coordinates.PDB" title="MDAnalysis.coordinates.PDB"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.coordinates.PDB</span></tt></a></td>
</tr>
<tr><td>PDBQT <a class="footnote-reference" href="#a" id="id3">[1]</a></td>
<td>pdbqt</td>
<td>r/w</td>
<td>file format used by AutoDock with atom types <em>t</em>
and partial charges <em>q</em>. Module:
<a class="reference internal" href="PDBQT.html#module-MDAnalysis.coordinates.PDBQT" title="MDAnalysis.coordinates.PDBQT"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.coordinates.PDBQT</span></tt></a></td>
</tr>
<tr><td>PQR <a class="footnote-reference" href="#a" id="id4">[1]</a></td>
<td>pqr</td>
<td>r</td>
<td>PDB-like but whitespace-separated files with charge
and radius information. Module
<a class="reference internal" href="PQR.html#module-MDAnalysis.coordinates.PQR" title="MDAnalysis.coordinates.PQR"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.coordinates.PQR</span></tt></a></td>
</tr>
<tr><td>GROMOS96
<a class="footnote-reference" href="#a" id="id5">[1]</a></td>
<td>gro</td>
<td>r/w</td>
<td>basic GROMOS96 format (without velocities). Module
<a class="reference internal" href="GRO.html#module-MDAnalysis.coordinates.GRO" title="MDAnalysis.coordinates.GRO"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.coordinates.GRO</span></tt></a></td>
</tr>
<tr><td>CHARMM <a class="footnote-reference" href="#a" id="id6">[1]</a></td>
<td>crd</td>
<td>r/w</td>
<td>&#8220;CARD&#8221; coordinate output from CHARMM; deals with
either standard or EXTended format. Module
<a class="reference internal" href="CRD.html#module-MDAnalysis.coordinates.CRD" title="MDAnalysis.coordinates.CRD"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.coordinates.CRD</span></tt></a></td>
</tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="a" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[1]</td><td><em>(<a class="fn-backref" href="#id2">1</a>, <a class="fn-backref" href="#id3">2</a>, <a class="fn-backref" href="#id4">3</a>, <a class="fn-backref" href="#id5">4</a>, <a class="fn-backref" href="#id6">5</a>)</em> This format can also be used to provide basic <em>topology</em>
information (i.e. the list of atoms); it is possible to create a
full <a class="reference internal" href="../core/AtomGroup.html#MDAnalysis.core.AtomGroup.Universe" title="MDAnalysis.core.AtomGroup.Universe"><tt class="xref py py-mod docutils literal"><span class="pre">Universe</span></tt></a> by simply
providing a file of this format: <tt class="docutils literal"><span class="pre">u</span> <span class="pre">=</span> <span class="pre">Universe(filename)</span></tt></td></tr>
</tbody>
</table>
</div>
<div class="section" id="trajectory-api">
<span id="id7"></span><h2>5.1.2. Trajectory API<a class="headerlink" href="#trajectory-api" title="Permalink to this headline">¶</a></h2>
<p>The <strong>Trajectory API</strong> defines how classes have to be structured that allow
reading and writing of coordinate files. By following the API it is possible to
seamlessly enhance the I/O capabilities of MDAnalysis. The actual underlying
I/O code can be written in C or python or a mixture thereof.</p>
<p>Typically, each format resides in its own module, named by the format specifier
(and using upper case by convention).</p>
<p>Reader and Writer classes are derived from base classes in
<a class="reference internal" href="base.html#module-MDAnalysis.coordinates.base" title="MDAnalysis.coordinates.base"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.coordinates.base</span></tt></a>.</p>
<div class="section" id="history">
<h3>5.1.2.1. History<a class="headerlink" href="#history" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>2010-04-30 Draft [orbeckst]</li>
<li>2010-08-20 added single frame writers to API [orbeckst]</li>
<li>2010-10-09 added write() method to Writers [orbeckst]</li>
<li>2010-10-19 use close() instead of close_trajectory() [orbeckst]</li>
<li>2010-10-30 clarified Writer write() methods (see also <a class="reference external" href="http://code.google.com/p/mdanalysis/issues/detail?id=49">Issue 49</a>)</li>
<li>2011-02-01 extended call signatur of Reader class</li>
<li>2011-03-30 optional Writer() method for Readers</li>
<li>2011-04-18 added time and frame managed attributes to Reader</li>
<li>2011-04-20 added volume to Timestep</li>
</ul>
</div>
<div class="section" id="registry">
<h3>5.1.2.2. Registry<a class="headerlink" href="#registry" title="Permalink to this headline">¶</a></h3>
<p>In various places, MDAnalysis tries to automatically select appropriate formats
(e.g. by looking at file extensions). In order to allow it to choose the
correct format, all I/O classes must be registered in one of three dictionaries
with the format (typically the file extension in upper case):</p>
<ul class="simple">
<li>Trajectory reader classes must be added to
<tt class="xref py py-data docutils literal"><span class="pre">MDAnalysis.coordinates._trajectory_readers</span></tt>.</li>
<li>Trajectory writer classes must be added to
<tt class="xref py py-data docutils literal"><span class="pre">MDAnalysis.coordinates._trajectory_writers</span></tt>.</li>
<li>Single-frame writer classes must be added to to
<tt class="xref py py-data docutils literal"><span class="pre">MDAnalysis.coordinates._frame_writers</span></tt>.</li>
</ul>
</div>
<div class="section" id="timestep-class">
<h3>5.1.2.3. Timestep class<a class="headerlink" href="#timestep-class" title="Permalink to this headline">¶</a></h3>
<p>A Timestep instance holds data for the current frame. It is updated whenever a
new frame of the trajectory is read.</p>
<p>Timestep classes are derived from
<a class="reference internal" href="base.html#MDAnalysis.coordinates.base.Timestep" title="MDAnalysis.coordinates.base.Timestep"><tt class="xref py py-class docutils literal"><span class="pre">MDAnalysis.coordinates.base.Timestep</span></tt></a>, which is the primary
implementation example (and used directly for the DCDReader).</p>
<div class="section" id="methods">
<h4>5.1.2.3.1. Methods<a class="headerlink" href="#methods" title="Permalink to this headline">¶</a></h4>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">__init__(arg)</span></tt></dt>
<dd><p class="first">depending on the type of <em>arg</em>, Timestep instances are created in
different ways:</p>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">int</span></tt></dt>
<dd>empty Timestep for <em>arg</em> atoms (allocate arrays etc)</dd>
<dt><tt class="xref py py-class docutils literal"><span class="pre">Timestep</span></tt></dt>
<dd>makes a deep copy of the <em>arg</em></dd>
<dt><a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.0.dev-4fb84e7)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a></dt>
<dd>update the Timesteps positions array with the contents of <em>arg</em></dd>
</dl>
</div></blockquote>
<p class="last">Anything else raises an exception; in particular it is not possible to
create a &#8220;empty&#8221; <tt class="xref py py-class docutils literal"><span class="pre">Timestep</span></tt> instance.</p>
</dd>
<dt><tt class="docutils literal"><span class="pre">__getitem__(atoms)</span></tt></dt>
<dd>position(s) of atoms; can be a slice or numpy array and then returns
coordinate array</dd>
<dt><tt class="docutils literal"><span class="pre">__len__()</span></tt></dt>
<dd>number of coordinates (atoms) in the frame</dd>
<dt><tt class="docutils literal"><span class="pre">__iter__()</span></tt></dt>
<dd>iterator over all coordinates</dd>
<dt><tt class="docutils literal"><span class="pre">copy()</span></tt></dt>
<dd>deep copy of the instance</dd>
</dl>
</div></blockquote>
</div>
<div class="section" id="attributes">
<h4>5.1.2.3.2. Attributes<a class="headerlink" href="#attributes" title="Permalink to this headline">¶</a></h4>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">numatoms</span></tt></dt>
<dd>number of atoms in the frame</dd>
<dt><tt class="docutils literal"><span class="pre">frame</span></tt></dt>
<dd>current frame number</dd>
<dt><tt class="docutils literal"><span class="pre">dimensions</span></tt></dt>
<dd>system box dimensions (<cite>x, y, z, alpha, beta, gamma</cite>)
(typically implemented as a property because it needs to translate whatever is in the
underlying <tt class="xref py py-attr docutils literal"><span class="pre">Timestep._unitcell</span></tt> attribute)</dd>
<dt><tt class="docutils literal"><span class="pre">volume</span></tt></dt>
<dd>system box volume (derived as the determinant of the box vectors of <tt class="docutils literal"><span class="pre">dimensions</span></tt>)</dd>
</dl>
</div></blockquote>
</div>
<div class="section" id="private-attributes">
<h4>5.1.2.3.3. Private attributes<a class="headerlink" href="#private-attributes" title="Permalink to this headline">¶</a></h4>
<p>These attributes are set directly by the underlying trajectory
readers. Normally the user should not have to directly access those (although in
some cases it is convenient to directly use <tt class="xref py py-attr docutils literal"><span class="pre">Timestep._pos</span></tt>).</p>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">_pos</span></tt></dt>
<dd>raw coordinates, a <tt class="xref py py-class docutils literal"><span class="pre">numpy.float32</span></tt> array; <tt class="docutils literal"><span class="pre">X</span> <span class="pre">=</span> <span class="pre">_pos[:,0],</span> <span class="pre">Y</span> <span class="pre">=</span>
<span class="pre">_pos[:,1],</span> <span class="pre">Z</span> <span class="pre">=</span> <span class="pre">_pos[:,2]</span></tt></dd>
<dt><tt class="docutils literal"><span class="pre">_unitcell</span></tt></dt>
<dd>unit cell dimensions and angles; the format depends on the underlying
trajectory format. A user should use <tt class="xref py py-attr docutils literal"><span class="pre">Timestep.dimensions</span></tt> to
access the data in a standard format.</dd>
</dl>
</div></blockquote>
</div>
</div>
<div class="section" id="trajectory-reader-class">
<h3>5.1.2.4. Trajectory Reader class<a class="headerlink" href="#trajectory-reader-class" title="Permalink to this headline">¶</a></h3>
<p>Trajectory readers are derived from <a class="reference internal" href="base.html#MDAnalysis.coordinates.base.Reader" title="MDAnalysis.coordinates.base.Reader"><tt class="xref py py-class docutils literal"><span class="pre">MDAnalysis.coordinates.base.Reader</span></tt></a>.
Typically, many methods and attributes are overriden.</p>
<div class="section" id="id8">
<h4>5.1.2.4.1. Methods<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h4>
<p>The <a class="reference internal" href="DCD.html#MDAnalysis.coordinates.DCD.DCDReader" title="MDAnalysis.coordinates.DCD.DCDReader"><tt class="xref py py-class docutils literal"><span class="pre">MDAnalysis.coordinates.DCD.DCDReader</span></tt></a> class is the primary
implementation example.</p>
<p><strong>Mandatory methods</strong></p>
<p>The following methods must be implemented in a Reader class.</p>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">__init__(filename,</span> <span class="pre">**kwargs)</span></tt></dt>
<dd><p class="first">open <em>filename</em>; other <em>kwargs</em> are processed as needed and the
Reader is free to ignore them. Typically, MDAnalysis supplies as
much information as possible to the Reader in <cite>kwargs</cite>; at the moment the
following data are supplied in keywords when a trajectory is loaded from
within <tt class="xref py py-class docutils literal"><span class="pre">MDAnalysis.Universe</span></tt>:</p>
<blockquote class="last">
<div><ul class="simple">
<li><em>numatoms</em>: the number of atoms (known from the topology)</li>
</ul>
</div></blockquote>
</dd>
<dt><tt class="docutils literal"><span class="pre">__iter__()</span></tt></dt>
<dd><p class="first">allow iteration from beginning to end:</p>
<div class="last highlight-python"><div class="highlight"><pre><span class="k">for</span> <span class="n">ts</span> <span class="ow">in</span> <span class="n">trajectory</span><span class="p">:</span>
    <span class="k">print</span> <span class="n">ts</span><span class="o">.</span><span class="n">frame</span>
</pre></div>
</div>
</dd>
<dt><tt class="docutils literal"><span class="pre">close()</span></tt></dt>
<dd>close the file and cease I/O</dd>
<dt><tt class="docutils literal"><span class="pre">__del__()</span></tt></dt>
<dd>ensure that the trajectory is closed</dd>
<dt><tt class="docutils literal"><span class="pre">next()</span></tt></dt>
<dd>advance to next time step or raise <tt class="xref py py-exc docutils literal"><span class="pre">IOError</span></tt> when moving
past the last frame</dd>
<dt><tt class="docutils literal"><span class="pre">rewind()</span></tt></dt>
<dd>reposition to first frame</dd>
</dl>
</div></blockquote>
<p><strong>Optional methods</strong></p>
<p>Not all trajectory formats support the following methods, either because the
data are not available or the methods have not been implemented. Code should
deal with missing methods gracefully.</p>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">__len__()</span></tt></dt>
<dd>number of frames in trajectory</dd>
<dt><tt class="docutils literal"><span class="pre">__getitem__(arg)</span></tt></dt>
<dd><p class="first">advance to time step <cite>arg</cite> = <cite>frame</cite> and return <tt class="xref py py-class docutils literal"><span class="pre">Timestep</span></tt>; or if <cite>arg</cite> is a
slice, then return an iterator over that part of the trajectory.</p>
<p>The first functionality allows one to randomly access frames in the
trajectory:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">universe</span><span class="o">.</span><span class="n">trajectory</span><span class="p">[</span><span class="mi">314</span><span class="p">]</span>
</pre></div>
</div>
<p>would load frame 314 into the current <tt class="xref py py-class docutils literal"><span class="pre">Timestep</span></tt>.</p>
<p>Using slices allows iteration over parts of a trajectory</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">for</span> <span class="n">ts</span> <span class="ow">in</span> <span class="n">universe</span><span class="o">.</span><span class="n">trajectory</span><span class="p">[</span><span class="mi">1000</span><span class="p">:</span><span class="mi">2000</span><span class="p">]:</span>
    <span class="n">process_frame</span><span class="p">(</span><span class="n">ts</span><span class="p">)</span>   <span class="c"># do something</span>
</pre></div>
</div>
<p>or skipping frames</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">for</span> <span class="n">ts</span> <span class="ow">in</span> <span class="n">universe</span><span class="o">.</span><span class="n">trajectory</span><span class="p">[</span><span class="mi">1000</span><span class="p">::</span><span class="mi">100</span><span class="p">]:</span>
    <span class="n">process_frame</span><span class="p">(</span><span class="n">ts</span><span class="p">)</span>   <span class="c"># do something</span>
</pre></div>
</div>
<p>The last example starts reading the trajectory at frame 1000 and
reads every 100th frame until the end.</p>
<p class="last">The performance of the <tt class="docutils literal"><span class="pre">__getitem__()</span></tt> method depends on the underlying
trajectory reader and if it can implement random access to frames. In many
cases this is not easily (or reliably) implementable and thus one is
restricted to sequential iteration.</p>
</dd>
<dt><tt class="docutils literal"><span class="pre">Writer(filename,</span> <span class="pre">**kwargs)</span></tt></dt>
<dd><p class="first">returns a <a class="reference internal" href="base.html#MDAnalysis.coordinates.base.Writer" title="MDAnalysis.coordinates.base.Writer"><tt class="xref py py-class docutils literal"><span class="pre">Writer</span></tt></a> which is set up with
the same parameters as the trajectory that is being read (e.g. time step,
length etc), which facilitates copying and simple on-the-fly manipulation.</p>
<p>If no Writer is defined then a <tt class="xref py py-exc docutils literal"><span class="pre">NotImplementedError</span></tt> is raised.</p>
<p class="last">The <em>kwargs</em> can be used to customize the Writer as they are typically
passed through to the init method of the Writer, with sensible defaults
filled in; the actual keyword arguments depend on the Writer.</p>
</dd>
<dt><tt class="docutils literal"><span class="pre">timeseries(atomGroup,</span> <span class="pre">[start[,stop[,skip[,format]]]])</span></tt></dt>
<dd>returns a subset of coordinate data</dd>
<dt><tt class="docutils literal"><span class="pre">correl(timeseriesCollection[,start[,stop[,skip]]])</span></tt></dt>
<dd>populate a <a class="reference internal" href="../core/Timeseries.html#MDAnalysis.core.Timeseries.TimeseriesCollection" title="MDAnalysis.core.Timeseries.TimeseriesCollection"><tt class="xref py py-class docutils literal"><span class="pre">MDAnalysis.core.Timeseries.TimeseriesCollection</span></tt></a> object
with observable timeseries computed from the trajectory</dd>
</dl>
</div></blockquote>
</div>
<div class="section" id="id9">
<h4>5.1.2.4.2. Attributes<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h4>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">filename</span></tt></dt>
<dd>filename of the trajectory</dd>
<dt><tt class="docutils literal"><span class="pre">numatoms</span></tt></dt>
<dd>number of atoms (coordinate sets) in a frame (constant)</dd>
<dt><tt class="docutils literal"><span class="pre">numframes</span></tt></dt>
<dd>total number of frames (if known) &#8211; <tt class="xref docutils literal"><span class="pre">None</span></tt> if not known</dd>
<dt><tt class="docutils literal"><span class="pre">fixed</span></tt></dt>
<dd>bool, saying if there are fixed atoms (e.g. dcds)</dd>
<dt><tt class="docutils literal"><span class="pre">skip</span></tt></dt>
<dd>step size for iterating through the trajectory [1]</dd>
<dt><tt class="docutils literal"><span class="pre">skip_timestep</span></tt></dt>
<dd>number of integrator steps between frames + 1 (i.e.
the stride at which the MD simulation was sampled)</dd>
<dt><tt class="docutils literal"><span class="pre">delta</span></tt></dt>
<dd>integrator time step (in native units); hence the &#8220;length&#8221;
of a trajctory frame is  <tt class="docutils literal"><span class="pre">skip_timestep*delta</span></tt> time units</dd>
<dt><tt class="docutils literal"><span class="pre">periodic</span></tt></dt>
<dd>contains box information for periodic boundary conditions</dd>
<dt><tt class="docutils literal"><span class="pre">ts</span></tt></dt>
<dd>the <tt class="xref py py-class docutils literal"><span class="pre">Timestep</span></tt> object; typically customized for each
trajectory format and derived from <tt class="xref py py-class docutils literal"><span class="pre">base.Timestep</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">units</span></tt></dt>
<dd>dictionary with keys <em>time</em> and <em>length</em> and the appropriate
unit (e.g. &#8216;AKMA&#8217; and &#8216;Angstrom&#8217; for Charmm dcds, &#8216;ps&#8217; and &#8216;nm&#8217;
for Gromacs trajectories, <tt class="xref docutils literal"><span class="pre">None</span></tt> and &#8216;Angstrom&#8217; for PDB).</dd>
<dt><tt class="docutils literal"><span class="pre">format</span></tt></dt>
<dd>string that identifies the file format, e.g. &#8220;DCD&#8221;, &#8220;PDB&#8221;, &#8220;CRD&#8221;, &#8220;XTC&#8221;,
&#8220;TRR&#8221;; this is typically the file extension in upper case.</dd>
<dt><tt class="docutils literal"><span class="pre">dt</span></tt></dt>
<dd>time between frames in ps; a managed attribute (read only) that computes
on the fly <tt class="docutils literal"><span class="pre">skip_timestep</span> <span class="pre">*</span> <span class="pre">delta</span></tt> and converts to the MDAnalysis base
unit for time (pico seconds by default)</dd>
<dt><tt class="docutils literal"><span class="pre">totaltime</span></tt></dt>
<dd>total length of the trajectory = <tt class="docutils literal"><span class="pre">numframes</span> <span class="pre">*</span> <span class="pre">dt</span></tt></dd>
<dt><tt class="docutils literal"><span class="pre">time</span></tt></dt>
<dd>time of the current time step, in MDAnalysis time units (ps)</dd>
<dt><tt class="docutils literal"><span class="pre">frame</span></tt></dt>
<dd>frame number of the current time step</dd>
</dl>
</div></blockquote>
<p><strong>Optional attributes</strong></p>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">compressed</span></tt></dt>
<dd>string that identifies the compression (e.g. &#8220;gz&#8221; or &#8220;bz2&#8221;) or <tt class="xref docutils literal"><span class="pre">None</span></tt>.</dd>
</dl>
</div></blockquote>
</div>
</div>
<div class="section" id="trajectory-writer-class">
<h3>5.1.2.5. Trajectory Writer class<a class="headerlink" href="#trajectory-writer-class" title="Permalink to this headline">¶</a></h3>
<p>Trajectory readers are derived from
<a class="reference internal" href="base.html#MDAnalysis.coordinates.base.Writer" title="MDAnalysis.coordinates.base.Writer"><tt class="xref py py-class docutils literal"><span class="pre">MDAnalysis.coordinates.base.Writer</span></tt></a>. They are use to write
multiple frames to a trajectory file. Every time the
<a class="reference internal" href="base.html#MDAnalysis.coordinates.base.Writer.write" title="MDAnalysis.coordinates.base.Writer.write"><tt class="xref py py-meth docutils literal"><span class="pre">write()</span></tt></a> method is called,
another frame is appended to the trajectory.</p>
<p>Typically, many methods and attributes are overriden.</p>
<p>Signature:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">W</span> <span class="o">=</span> <span class="n">TrajectoryWriter</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span><span class="n">numatoms</span><span class="p">,</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="n">W</span><span class="o">.</span><span class="n">write_next_timestep</span><span class="p">(</span><span class="n">Timestep</span><span class="p">)</span>
</pre></div>
</div>
<p>or:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">W</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">AtomGroup</span><span class="p">)</span>   <span class="c"># write a selection</span>
<span class="n">W</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">Universe</span><span class="p">)</span>    <span class="c"># write a whole universe</span>
<span class="n">W</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">Timestep</span><span class="p">)</span>    <span class="c"># same as write_next_timestep()</span>
</pre></div>
</div>
<div class="section" id="id10">
<h4>5.1.2.5.1. Methods<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h4>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">__init__(filename,numatoms[,start[,step[,delta[,remarks]]]])</span></tt></dt>
<dd>opens <em>filename</em> and writes header if required by format</dd>
<dt><tt class="docutils literal"><span class="pre">write(obj)</span></tt></dt>
<dd>write Timestep data in <em>obj</em></dd>
<dt><tt class="docutils literal"><span class="pre">write_next_timestep([timestep])</span></tt></dt>
<dd>write data in <em>timestep</em> to trajectory file</dd>
<dt><tt class="docutils literal"><span class="pre">convert_dimensions_to_unitcell(timestep)</span></tt></dt>
<dd>take the dimensions from the timestep and convert to the native
unitcell representation of the format</dd>
<dt><tt class="docutils literal"><span class="pre">close_trajectory()</span></tt></dt>
<dd>close file and finish I/O</dd>
<dt><tt class="docutils literal"><span class="pre">__del__()</span></tt></dt>
<dd>ensures that close() is called</dd>
</dl>
</div></blockquote>
</div>
<div class="section" id="id11">
<h4>5.1.2.5.2. Attributes<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h4>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">filename</span></tt></dt>
<dd>name of the trajectory file</dd>
<dt><tt class="docutils literal"><span class="pre">start,</span> <span class="pre">stop,</span> <span class="pre">step</span></tt></dt>
<dd>first and last frame and step</dd>
<dt><tt class="docutils literal"><span class="pre">units</span></tt></dt>
<dd>dictionary with keys <em>time</em> and <em>length</em> and the appropriate
unit (e.g. &#8216;AKMA&#8217; and &#8216;Angstrom&#8217; for CHARMM dcds, &#8216;ps&#8217; and &#8216;nm&#8217;
for Gromacs trajectories, <tt class="xref docutils literal"><span class="pre">None</span></tt> and &#8216;Angstrom&#8217; for PDB)</dd>
<dt><tt class="docutils literal"><span class="pre">format</span></tt></dt>
<dd>string that identifies the file format, e.g. &#8220;DCD&#8221;, &#8220;PDB&#8221;, &#8220;CRD&#8221;, &#8220;XTC&#8221;,
&#8220;TRR&#8221;</dd>
</dl>
</div></blockquote>
<p><strong>Optional</strong></p>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">ts</span></tt></dt>
<dd><tt class="xref py py-class docutils literal"><span class="pre">Timestep</span></tt> instance</dd>
</dl>
</div></blockquote>
</div>
</div>
<div class="section" id="single-frame-writer-class">
<h3>5.1.2.6. Single Frame Writer class<a class="headerlink" href="#single-frame-writer-class" title="Permalink to this headline">¶</a></h3>
<p>A single frame writer is a special case of a trajectory writer in that it
writes only a single coordinate frame to a file, for instance, a pdb or gro
file. Unlike trajectory formats, which only contains coordinates, <em>single
frame</em> formats contain much more information (e.g. atom and residue names and
numbers) and hence it is possible to write selections of atoms in a meaningful
way.</p>
<p>Signature:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">W</span> <span class="o">=</span> <span class="n">FrameWriter</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="n">W</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">AtomGroup</span><span class="p">)</span>
<span class="n">W</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">Universe</span><span class="p">)</span>
</pre></div>
</div>
<p>The blanket <em>kwargs</em> is required so that one can pass the same kind of
arguments (filename and numatoms) as for the Trajectory writers. In
this way, the simple <a class="reference internal" href="core.html#MDAnalysis.coordinates.core.writer" title="MDAnalysis.coordinates.core.writer"><tt class="xref py py-func docutils literal"><span class="pre">writer()</span></tt></a>
factory function can be used for all writers.</p>
<div class="section" id="id12">
<h4>5.1.2.6.1. Methods<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h4>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">__init__(filename,</span> <span class="pre">**kwargs)</span></tt></dt>
<dd>opens <em>filename</em> for writing; <cite>kwargs</cite> are typically ignored</dd>
<dt><tt class="docutils literal"><span class="pre">write(obj)</span></tt></dt>
<dd>writes the object <em>obj</em>, containing a
<a class="reference internal" href="../core/AtomGroup.html#MDAnalysis.core.AtomGroup.AtomGroup" title="MDAnalysis.core.AtomGroup.AtomGroup"><tt class="xref py py-class docutils literal"><span class="pre">AtomGroup</span></tt></a> group of atoms (typically
obtained from a selection) or <a class="reference internal" href="../core/AtomGroup.html#MDAnalysis.core.AtomGroup.Universe" title="MDAnalysis.core.AtomGroup.Universe"><tt class="xref py py-class docutils literal"><span class="pre">Universe</span></tt></a>
to the file and closes the file</dd>
</dl>
</div></blockquote>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Trajectory and Frame writers can be used in almost exactly the same
manner with the one difference that Frame writers cannot deal with
raw <a class="reference internal" href="base.html#MDAnalysis.coordinates.base.Timestep" title="MDAnalysis.coordinates.base.Timestep"><tt class="xref py py-class docutils literal"><span class="pre">Timestep</span></tt></a> objects.</p>
</div>
</div>
</div>
</div>
<div class="section" id="reader-writer-registry">
<h2>5.1.3. Reader/Writer registry<a class="headerlink" href="#reader-writer-registry" title="Permalink to this headline">¶</a></h2>
<p>The following data structures connect reader/writer classes to their
format identifiers. They are documented for programmers who want to
enhance MDAnalysis; the casual user is unlikely to access them
directly.</p>
<dl class="data">
<dt id="MDAnalysis.coordinates.__init__._trajectory_readers">
<tt class="descclassname">MDAnalysis.coordinates.__init__.</tt><tt class="descname">_trajectory_readers</tt><a class="headerlink" href="#MDAnalysis.coordinates.__init__._trajectory_readers" title="Permalink to this definition">¶</a></dt>
<dd><p>standard trajectory readers (dict with identifier as key and reader class as value)</p>
</dd></dl>

<dl class="data">
<dt id="MDAnalysis.coordinates.__init__._topology_coordinates_readers">
<tt class="descclassname">MDAnalysis.coordinates.__init__.</tt><tt class="descname">_topology_coordinates_readers</tt><a class="headerlink" href="#MDAnalysis.coordinates.__init__._topology_coordinates_readers" title="Permalink to this definition">¶</a></dt>
<dd><p>readers of files that contain both topology/atom data and coordinates
(currently only the keys are used)</p>
</dd></dl>

<dl class="data">
<dt id="MDAnalysis.coordinates.__init__._trajectory_readers_permissive">
<tt class="descclassname">MDAnalysis.coordinates.__init__.</tt><tt class="descname">_trajectory_readers_permissive</tt><a class="headerlink" href="#MDAnalysis.coordinates.__init__._trajectory_readers_permissive" title="Permalink to this definition">¶</a></dt>
<dd><p>hack: readers that ignore most errors (permissive=True); at the moment
the same as <a class="reference internal" href="#MDAnalysis.coordinates.__init__._trajectory_readers" title="MDAnalysis.coordinates.__init__._trajectory_readers"><tt class="xref py py-data docutils literal"><span class="pre">_trajectory_readers</span></tt></a> with the exception of the
the PDB reader (<a class="reference internal" href="PDB.html#MDAnalysis.coordinates.PDB.PDBReader" title="MDAnalysis.coordinates.PDB.PDBReader"><tt class="xref py py-class docutils literal"><span class="pre">PDBReader</span></tt></a> is replaced by <a class="reference internal" href="PDB.html#MDAnalysis.coordinates.PDB.PrimitivePDBReader" title="MDAnalysis.coordinates.PDB.PrimitivePDBReader"><tt class="xref py py-class docutils literal"><span class="pre">PrimitivePDBReader</span></tt></a>).</p>
</dd></dl>

<dl class="data">
<dt id="MDAnalysis.coordinates.__init__._compressed_formats">
<tt class="descclassname">MDAnalysis.coordinates.__init__.</tt><tt class="descname">_compressed_formats</tt><a class="headerlink" href="#MDAnalysis.coordinates.__init__._compressed_formats" title="Permalink to this definition">¶</a></dt>
<dd><p>formats of readers that can also handle gzip or bzip2 compressed files</p>
</dd></dl>

<dl class="data">
<dt id="MDAnalysis.coordinates.__init__._frame_writers">
<tt class="descclassname">MDAnalysis.coordinates.__init__.</tt><tt class="descname">_frame_writers</tt><a class="headerlink" href="#MDAnalysis.coordinates.__init__._frame_writers" title="Permalink to this definition">¶</a></dt>
<dd><p>frame writers: export to single frame formats such as PDB, gro, crd
Signature:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">W</span> <span class="o">=</span> <span class="n">FrameWriter</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
<span class="n">W</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">AtomGroup</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="data">
<dt id="MDAnalysis.coordinates.__init__._trajectory_writers">
<tt class="descclassname">MDAnalysis.coordinates.__init__.</tt><tt class="descname">_trajectory_writers</tt><a class="headerlink" href="#MDAnalysis.coordinates.__init__._trajectory_writers" title="Permalink to this definition">¶</a></dt>
<dd><p>trajectory writers: export frames, typically only saving coordinates
Signature:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">W</span> <span class="o">=</span> <span class="n">TrajectoryWriter</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span><span class="n">numatoms</span><span class="p">,</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="n">W</span><span class="o">.</span><span class="n">write_next_timestep</span><span class="p">(</span><span class="n">TimeStep</span><span class="p">)</span>
<span class="n">W</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">Timestep</span><span class="p">)</span>
<span class="n">W</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">AtomGroup</span><span class="p">)</span>
<span class="n">W</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">Universe</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="base.html" title="5.2. Base classes — MDAnalysis.coordinates.base"
             >next</a> |</li>
        <li class="right" >
          <a href="../coordinates_modules.html" title="5. Coordinates modules"
             >previous</a> |</li>
        <li><a href="../../index.html">MDAnalysis v0.7.5-devel documentation</a> &raquo;</li>
          <li><a href="../coordinates_modules.html" >5. Coordinates modules</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2005-2011, Naveen Michaud-Agrawal, Elizabeth J. Denning, Joshua Adelman,
    Christian Beckstein (logo), David Caplan, Jan Domański, Philip Fowler,
    Joseph Goose, Benjamin Hall, Danny Parton, Tyler Reddy, Paul Rigor,
    and Oliver Beckstein.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>
  </body>
</html>